<?php
include_once BONE_ROOT.DS.APP_DIR.DS.'templates'.DS.'user'.DS.'user.php';

class template_edit extends template_user
{

	protected function head()
	{
	?>
<script type="text/javascript" language="javascript" src="templates/user/js/edit.js"></script>
	<?php
	}
	
	protected function center()
	{
		
		$user = $this->get('user');
		
		$this->toolbar();
		?>

<div class="box">
	<div class="box-tl"><div class="box-tr"><div class="box-tm"></div></div></div>	
	<div class="box-m">
		
		<h3 class="title"><?php echo $this->get_title(); ?></h3>
		
		<form action="./" method="post" onsubmit="javascript: return chkForm(<?php echo $user->id; ?>);">
		<table class="edit-table">
		<tbody>
		<tr>
		<td class="key">用户名</td>
		<td><input type="text" name="username" id="username" value="<?php echo $user->username; ?>" style="width:200px;" /></td>
		</tr>
		<tr>
		<td class="key">邮箱</td>
		<td><input type="text" name="email" id="email" value="<?php echo $user->email; ?>" style="width:200px;" /></td>
		</tr>
		<tr>
		<td class="key">名字</td>
		<td><input type="text" name="name" id="name" value="<?php echo $user->name; ?>" style="width:120px;" /></td>
		</tr>
		<tr>
		<td class="key">设置密码</td>
		<td><input type="password" name="password" id="password1" style="width:180px;" /> <?php if($user->id!=0) echo '* 留空时不改动'; ?></td>
		</tr>
		<tr>
		<td class="key">确认密码</td>
		<td><input type="password" name="password2" id="password2" style="width:180px;" /></td>
		</tr>
		<tr>
		<td class="key">登陆后台权限</td>
		<td><input type="checkbox" name="is_admin" value="1" <?php if($user->is_admin==1) echo 'checked'; ?> <?php if($user->id==1) echo 'disabled'; ?> /></td>
		</tr>
		<tr>
		<td class="key">屏蔽该用户</td>
		<td><input type="checkbox" name="block" value="1" <?php if($user->block==1) echo 'checked'; ?> <?php if($user->id==1) echo 'disabled'; ?> /></td>
		</tr>
		<tr>
		<td class="key"></td>
		<td>
		<input class="btn" type="submit" value="保存" /> <input class="btn" type="button" value="返回" onclick="javascript:window.history.go(-1);" />
		</td>
		</tr>
		</tbody>
		</table>
		<input type="hidden" name="id" value="<?php echo $user->id; ?>" />
		<input type="hidden" name="controller" value="user" />
		<input type="hidden" name="task" value="edit_save" />
		</form>
	</div>
	<div class="box-bl"><div class="box-br"><div class="box-bm"></div></div></div>
</div>
		

		<?php
		
	}	

}
?>